package com.sky.mapper;

import com.sky.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

/**
 * @version 1.0
 * @Title: UserMapper
 * @Author 张宇
 * @Package com.sky.mapper
 * @Date 2025/10/3 18:08
 */


@Mapper
public interface UserMapper {


    @Select("select * from user where openid=#{openId}")
    User selectByOpenid(String openId);


    @Options(useGeneratedKeys = true,keyProperty = "id")
    @Insert("insert into user (openid, name, create_time) VALUES (#{openid},#{name},#{createTime})")
    void insert(User user);
}
